import akka.actor.ActorRef
import io.netty.channel.ChannelHandlerContext
import io.netty.channel.SimpleChannelInboundHandler
import xhhx.network.C2sMsg

class ClientHandler : SimpleChannelInboundHandler<C2sMsg>() {
    override fun channelRead0(ctx: ChannelHandlerContext?, msg: C2sMsg) {
        if (ctx != null){
            countRef.tell(CountActor.RecMsg(ctx.channel(), msg.msgId, msg.receive), ActorRef.noSender())
        }
    }

    override fun channelActive(ctx: ChannelHandlerContext?) {
        super.channelActive(ctx)
    }

    override fun channelInactive(ctx: ChannelHandlerContext?) {
        super.channelInactive(ctx)
    }
}